<script setup lang="ts">
import { getLikeCollectList } from '@/api/article'
import type { LikeArticleData, QuestionList } from '@/types/data'
import { ref, onMounted } from 'vue'
import { useRouter } from 'vue-router'
import LikeVue from './components/like_list.vue'
const router = useRouter()
const list = ref<QuestionList>({
  current: 1,
  pageTotal: 10,
  pageSize: 10,
  total: 0,
  rows: []
})
// 点赞传1
const queryParams = ref<LikeArticleData>({
  optType: 1,
  page: 1,
  pageSize: 10
})
// 获取数据列表
const getLikeCollectListAPI = async () => {
  const res = await getLikeCollectList(queryParams.value)
  console.log(res)
  list.value.rows = res.data.rows
}
onMounted(() => {
  getLikeCollectListAPI()
})
</script>
<template>
  <div>
    <van-nav-bar title="喜欢" left-text="返回" left-arrow @click-left="router.back()" />
    <LikeVue v-for="item in list.rows" :key="item.id" :item="item"></LikeVue>
  </div>
</template>
<style scoped lang="ts"></style>
